% !Mode:: "TeX:UTF-8"
% !TEX program = xelatex
\documentclass[cs4size,a4paper,fancyhdr,fntef,oneside,openany]{ctexbook}
\usepackage[a4paper,top=51pt,bottom=51pt,left=68pt,right=57pt,headsep=14pt,footskip=26pt,includehead, includefoot]{geometry}
\title{你好，\LaTeX}
\author{Monster,Bruce}
\makeatletter
\let\OLDappendix\appendix
\newif\if@appendixinbackmatter
\renewenvironment{appendix}
{
  \if@mainmatter
     \@appendixinbackmatterfalse\OLDappendix
  \else
      \@appendixinbackmattertrue\@mainmattertrue\OLDappendix
 \fi
}
\makeatother
\begin{document}
\maketitle
\frontmatter
\tableofcontents
\mainmatter
\include{contents/intro}
\backmatter
\appendix
\chapter{我是第一个附录}
\section{我是第一个附录的第一节}
\chapter{我是第二个附录}
\end{document}